package com.project;

import com.project.bean.RoomBean;
import com.project.config.MyBatisConfig;
import com.project.service.ICityService;
import com.project.service.ICountryService;
import com.project.service.IRoomService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import java.time.LocalDate;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = MyBatisConfig.class)
public class test {

    @Autowired
    private ICountryService service;

    @Autowired
    private ICityService cityService;

    @Autowired
    private IRoomService roomService;

    @Test
    public void test(){

//        System.out.println(service.findAll());
//        System.out.println(cityService.findByCountry(1));

//        roomService.findById(2);
        System.out.println(roomService.findByItem(1, "路",null,null));
//        roomService.add(new RoomBean("新华公园",200020, LocalDate.parse("2001-12-12")));
//        roomService.del(2);
//        roomService.update(3,19129122);
    }

}
